import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
import { View, Text } from 'react-native';

// 在此处定义默认装饰器
export const decorators = [
  withBackgrounds,
  (Story) => (
    <View style={{ flex: 1 }}>
      <View style={{ height: 480+24, width: 320+24,borderWidth:12,borderColor:'black' }} >
        <View style={{ height: 64, backgroundColor: 'white',
          justifyContent: 'center',
          alignItems: 'center', }} >
            <Text style={{color: "#222222", fontSize: 16, fontWeight: "bold"}}>组件预览</Text>
          </View>
        <View style={{
          flex: 1,
          backgroundColor: '#EEEEEE',
          justifyContent: 'center',
          alignItems: 'center',
        }}>
          <Story />
          <View style={{ flex: 1, }} />
        </View>
      </View>
    </View>
  ),
];

// 在此处定义默认背景色
export const parameters = {
  backgrounds: {
    default: 'plain',
    // default: 'cool',
    values: [
      { name: 'plain', value: '#EEEEEE' },
      // { name: 'plain', value: 'white' },
      { name: 'warm', value: 'hotpink' },
      { name: 'cool', value: 'deepskyblue' },
    ],
  },
};
